package com.focus.xyz.other.pages.tpytb;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

/**
 * Created by chenmeng on 2016/3/30.
 */
public class ProductPage {

    @FindBy(xpath = "//input[@name='productCode']")
    private WebElement proCode;
    @FindBy(xpath = "//input[@value='查询']")
    private WebElement queryBtn;
    @FindBy(xpath = "//*[@id=\"datatable\"]/tbody/tr[2]")
    private WebElement proRow;
    @FindBy(xpath = "//input[@value='我要投保']")
    private WebElement tbBtn;

    /*public ProductPage(WebDriver driver){
        PageFactory.initElements(driver,this);
    }*/

    public void selectProd() throws Exception{
        if(proRow!=null){
            this.proRow.click();
        }
    }

    public void iwantTb() throws Exception{
        this.tbBtn.click();
    }

    public void inputProdCode(String code) throws Exception{
        this.proCode.clear();
        this.proCode.sendKeys(code);
    }

    public void queryProd() throws Exception{
        this.queryBtn.click();
    }


}
